package com.ihighest.app.infox.activity;

import org.json.JSONException;

import android.os.Bundle;
import android.webkit.WebView;

import com.ihighest.app.common.api.Api;
import com.ihighest.app.common.api.ApiCallback;
import com.ihighest.app.common.api.ApiResult;
import com.ihighest.app.infox.R;
import com.ihighest.app.infox.myview.ActivityTitle;

public class RegisterAgreeActivity extends BaseActivity {
	WebView agreeWebView;
	private ActivityTitle title;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);

		setContentView(R.layout.infox_webview_layout);

		title = (ActivityTitle) findViewById(R.id.infox_agreeTitle);
		// title.setTitle("金草帽");
		title.setViewVersible(title.titleBack);
		title.setViewGone(title.titleSetting, title.titleOther, title.rightLayout, title.titleRefresh, title.titleMsg, title.top_title_text);

		getdata();
		agreeWebView = (WebView) findViewById(R.id.id_webview);

	}

	private void getdata() {
		// TODO Auto-generated method stub
		Api.data("reg_protocol_normal.json", new ApiCallback(this) {

			@Override
			public void handleSuccess(ApiResult result) {
				// TODO Auto-generated method stub

				try {
					agreeWebView.loadData(result.getData().getString("content"), "text/html; charset=UTF-8", null);
				} catch (JSONException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}

			}

			@Override
			public void handleFailure(Exception e, String msg) {
				// TODO Auto-generated method stub

			}
		}, RegisterAgreeActivity.this);

	}

}
